import Vue from 'vue'
import App from './App.vue'
import "bootstrap/dist/css/bootstrap.css"
import "./assets/fonts/iconfont.css"
import MyGoodsList from './views/MyGoodsList.vue'
import MyGoodsSearch from './views/MyGoodsSearch.vue'
import MyUserInfo from './views/MyUserInfo.vue'
// 1.引入'vue-router'组件
import VueRouter from 'vue-router'
// 引入组件
import axios from 'axios'
// 基础地址
axios.defaults.baseURL='https://www.escook.cn'
// 全局注册 挂载原型
Vue.prototype.$axios=axios
// 2.注册全局使用
Vue.use(VueRouter)
Vue.config.productionTip = false
// 3

// 4.
const routes = [
  {
    path:'/',
    redirect: "/MyGoodsList"
  },
  {
    path: "/MyGoodsSearch",
    name:"MyGoodsSearch",
    component: MyGoodsSearch
  },
  {
    path: "/MyGoodsList",
    name:"MyGoodsList",
    component: MyGoodsList
  },
  {
    path: "/MyUserInfo",
    name:"MyUserInfo",
    component: MyUserInfo
  },

  
]
const router = new VueRouter({
  routes
})
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
    return originalPush.call(this, location).catch(err => err)
}
new Vue({
  router,
  render: h => h(App),
}).$mount('#app')
